//
//  ReservationData.m
//  Doctor1.0
//
//  Created by mk on 15/11/5.
//  Copyright (c) 2015年 cocoa-mk. All rights reserved.
//

#import "ReservationData.h"

@implementation ReservationData

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSDictionary class]])
    {
        self.dataID = NullObjToString(dataObj[@"id"]);
        self.refNo =  NullObjToString(dataObj[@"refNo"]);
        self.expertName = NullObjToString(dataObj[@"expertName"]);
        self.hpName = NullObjToString(dataObj[@"hpName"]);
        self.hpDeptName = NullObjToString(dataObj[@"hpDeptName"]);
        self.actionUrl = NullObjToString(dataObj[@"actionUrl"]);
        self.dateEnd = NullObjToString(dataObj[@"dateEnd"]);
        self.dateStart = NullObjToString(dataObj[@"dateStart"]);
    }
}


@end


@implementation ReservationListData

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSArray class]])
    {
        for (int i = 0; i < [dataObj count]; i++) {
            NSDictionary *dicRec = [dataObj objectAtIndex:i];
            ReservationData *recData = [[ReservationData alloc] init];
            [recData parseData:dicRec];
            [self.dataArray addObject:recData];
        }
    }
}


@end



